package com.chint.springboot.service;

import com.chint.springboot.model.pojo.Resume;
import jakarta.persistence.EntityManager;
import jakarta.persistence.PersistenceContext;
import jakarta.persistence.Query;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class ResumeService {
    @PersistenceContext
    private EntityManager entityManager;
    public List<Resume> findAll(){

       // String sql = "SELECT u.id, u.name, u.email FROM users u WHERE u.name LIKE '%John%'";
       // Query query = entityManager.createNativeQuery(sql);
       // return query.getResultList();
        return entityManager.createQuery("select r from Resume r", Resume.class).getResultList();
    }
}
